﻿@model Microsoft.AspNet.Identity.EntityFramework.IdentityRole
@{
    ViewBag.Title = "Index";
}

<h2>Role Manager</h2>

@using(Html.BeginForm()){
    <div>Role Id</div>
    @Html.TextBoxFor(m => m.Id)
    
    <div>Role Name</div>
    @Html.TextBoxFor(m => m.Name)
    
    <hr />
    <button onclick="form.action='/Role/Insert'">Insert</button>
    <button onclick="form.action='/Role/Update'">Update</button>
    <button onclick="form.action='/Role/Delete'">Delete</button>
    <button onclick="form.action='/Role/Index'">Reset</button>
}

<table class="table">
    <tr>
        <th>Id</th>
        <th>Name</th>
        <th></th>
    </tr>
    @foreach (var r in ViewBag.Roles)
    {
        <tr>
            <td>@r.Id</td>
            <td>@r.Name</td>
            <td>
                <a href="/Role/Edit/@r.Id">Edit</a>
            </td>
        </tr>
    }
</table>